package com.blakebeats;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class Main extends Activity {

	MediaPlayer mpSplash;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splashpage);

		mpSplash = MediaPlayer.create(this, R.raw.aura);
		mpSplash.start();

		Thread logoTimer = new Thread() {

			public void run() {

				try {
					int logoTimer = 0;
					while (logoTimer < 1000) {
						sleep(100);
						logoTimer = logoTimer + 100;
					}
					startActivity(new Intent("com.blakebeats.CLEARSCREEN"));
				} catch (InterruptedException e) {
					e.printStackTrace();

				} finally {
					finish();
				}

			}
		};
		logoTimer.start();

	}

	@Override
	protected void onDestroy() {
		super.onDestroy();

		mpSplash.release();
	}

	@Override
	protected void onPause() {
		super.onPause();
		mpSplash.pause();
	}

	@Override
	protected void onResume() {
		super.onResume();
		mpSplash.start();
	}

	@Override
	protected void onStart() {
		super.onStart();
		mpSplash.start();
	}

	@Override
	protected void onStop() {
		super.onStop();
		mpSplash.stop();
	}

}